package com.jyw.system.domain.dto;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.jyw.common.constant.SysDictTypeConstant;
import com.jyw.common.core.domain.entity.SysUser;
import com.jyw.common.utils.DateUtils;
import com.jyw.common.utils.SecurityUtils;
import com.jyw.common.utils.bean.BeanUtils;
import com.jyw.common.utils.spring.SpringUtils;
import com.jyw.system.service.ISysDictDataService;
import com.jyw.system.utils.DeptUtils;
import com.jyw.system.utils.UserUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.ObjectUtils;

import java.math.BigDecimal;
import java.util.Date;

@Data
@ApiModel("资产导入请求实体")
@Slf4j
public class UserImportDto {

    @ApiModelProperty("用户昵称")
    @ExcelProperty(index = 0)
    private String nickName;

    @ApiModelProperty("用户名称")
    @ExcelProperty(index = 1)
    private String userName;

    @ApiModelProperty("手机号码")
    @ExcelProperty(index = 2)
    private String phonenumber;

    @ApiModelProperty("状态")
    @ExcelProperty(index = 3)
    private String status;

    @ApiModelProperty("用户密码")
    @ExcelProperty(index = 4)
    private String password;


    public SysUser buildInfo(){
        SysUser user = new SysUser();
        BeanUtils.copyProperties(this,user);
        if(!ObjectUtils.isEmpty(getStatus())){
            switch (getStatus()){
                case "正常":
                    user.setStatus("0");
                    break;
                case "停用":
                    user.setStatus("1");
                    break;
                default:
                    user.setStatus(null);
                    break;
            }
        }
        return user;
    }

}
